#!/bin/bash

data=$(readlink -f $1)
outdir=$2
mkdir -p $outdir
cat $data/*.txt | awk '{$1=$1".flac";print $0}' > $outdir/out.txt #合并txt
cd $outdir
awk -F '.flac' '{print "\n"$2}' out.txt > next.txt #按字符分切
cat next.txt | grep '\S' > final.txt #去除空行